﻿using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Sharp.WebBooter.Areas.CMS.Models
{
    [DataContract]
    public class TreeNode
    {
        public TreeNode()
        {
            this.Nodes = new List<TreeNode>();
            this.Color = "#000000";
        }

        public TreeNode(string id, string text)
        {
            this.Nodes = new List<TreeNode>();
            this.Id = id;
            this.Text = text;
            this.Color = "#000000";
        }

        public TreeNode(string id, string text, string icon)
        {
            this.Nodes = new List<TreeNode>();
            this.Id = id;
            this.Text = text;
            this.Icon = icon;
            this.Color = "#000000";
        }

        public TreeNode(string id, string text, string icon, string state)
        {
            this.Nodes = new List<TreeNode>();
            this.Id = id;
            this.Text = text;
            this.Icon = icon;
            this.Color = "#000000";
        }

        [DataMember(Name = "id")]
        public string Id { get; set; }

        [DataMember(Name = "text")]
        public string Text { get; set; }

        [DataMember(Name = "color")]
        public string Color { get; set; }

        [DataMember(Name = "icon")]
        public string Icon { get; set; }


        [DataMember(Name = "nodes")]
        public List<TreeNode> Nodes { get; set; }

        /// <summary>
        /// 原始数据
        /// </summary>
        [DataMember(Name = "raw")]
        public object Raw { get; set; }
    }

}
